package cn.zxcoder.entity.SystemManage;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author zx
 * @since 2023-05-06
 */
@TableName("sys_role")
@ApiModel(value = "Role对象", description = "系统的角色对象")
@Data
public class Role implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("角色名称")
    @TableField(value = "role_Name")
    private String roleName;

    @TableField(value = "role_code")
    @ApiModelProperty("角色的代码：比如 admin")
    private String roleCode;

    @TableField(value = "sys_code")
    @ApiModelProperty("系统编码")
    private String sysCode;

    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @ApiModelProperty("编辑时间")
    private Date editTime;

    @ApiModelProperty("编辑用户")
    private String editUser;

    @TableField(value = "role_rights")
    @ApiModelProperty("所拥有的全部权限id字符串")
    private String roleRights;

    @TableField(exist = false)
    @ApiModelProperty("所拥有的全部权限id数组")
    private List<Right> rights;




    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }
    public String getCode() {
        return roleCode;
    }

    public void setCode(String roleCode) {
        this.roleCode = roleCode;
    }

    @Override
    public String toString() {
        return "Role{" +
            "id=" + id +
            ", roleName=" + roleName +
            ", roleCode=" + roleCode +
        "}";
    }
}
